<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
/*子孙后代选择器  */
 	body span{
 	 color: red;
 	} 
 	
 	div span{
 	background-color: blue;
 	}
/*子元素选择器  */
 	
 	body>span{
 		color: yellow;
 	}
 	body>div>span{
 	  background-color:pink;
 	}
 	
</style>
</head>
<body>
<span>span1</span>
<div>
	<span>span2</span>
		<div>
			<span>span3</span>
		</div>
		<div>
			<span>span4</span>
		</div>
</div>

</body>
</html>